import java.io.*;

public class Bytes
{
	public static void main(String[] args) {
		byte[] buffer = new byte[18];
		long l = 99999;
		ByteArrayOutputStream out = new ByteArrayOutputStream(8);
		DataOutputStream dout  = new DataOutputStream(out);
		try {
		dout.writeLong(l);
		}catch (IOException ex) {
			System.out.println("IOException");
		}
		finally {} 
	   
	    try{
			dout.close();
		} catch(IOException ex) { }
		finally{ }	

	
		DataInputStream in = 
			new DataInputStream(
					new ByteArrayInputStream(buffer));
		long ll=0;
		try {
			ll = in.readLong();
			System.out.println(ll);
		} catch (IOException ex) {
			System.out.println("IOException");
		}
		finally {}
		System.out.println(ll);

	}
}
